Fix task filtering, improve state management, and UI enhancements #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes Implemented
1. State Management with Jotai
tasksAtom) usingatomWithStorage, allowing tasks to persist in local storage.useTaskshook to manage tasks usinguseAtom.2. Bug Fixes
useTasksto correctly return completed, pending, or all tasks based on the selected filter.3. Code Refactoring & Improvements
useTasks.getNewTaskIdto ensure new tasks have unique IDs.4. UI Enhancements
framer-motionanimations to enhance user experience.ConfirmModal) before deleting a task.5. Testing Improvements
Headless UIby adding jsdom-testing-mocks.Assumptions Made
atomWithStorageis used.id, handled bygetNewTaskId.How to Test the Improvements
1. Run the Application
http://localhost:5173in a browser.2. Test Task Functionality
a) Adding a Task
b) Marking a Task as Completed
c) Deleting a Task
d) Filtering Tasks
3. Run Tests
pnpm test